<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "hl_label".
 *
 * @property int $id ID
 * @property string $title 标签名称
 * @property string $add_time 创建时间
 * @property string $created_at 创建时间
 * @property string $updated_at 修改时间
 * @property string $deleted_at 删除时间
 */
class HlLabel extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'hl_label';
    }

    /**
     * 自动更新时间
     */
    public function behaviors()
    {
        return [
            [
                'class' => \yii\behaviors\TimestampBehavior::className(),
                'value' => function () {
                    return date('Y-m-d H:i:s');
                },
            ],
        ];
    }
    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['add_time', 'created_at', 'updated_at', 'deleted_at'], 'safe'],
            [['title'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => '标签名',
            'add_time' => 'Add Time',
            'created_at' => '添加时间',
            'updated_at' => '修改时间',
            'deleted_at' => 'Deleted At',
        ];
    }
}
